package client;

import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.Serializable;

import javax.imageio.ImageIO;
import javax.swing.JPanel;

public class PannelloSfondo extends JPanel implements Serializable {
	
	BufferedImage img;
	int width;
	int height;

	public PannelloSfondo(File f){
		super(true);
		try{
			setImage(ImageIO.read(f));
		} catch(Exception e) {}

	}

	public void setImage(BufferedImage img){
		this.img = img;
		width = img.getWidth();
		height = img.getHeight();
	}

	public void paintComponent(Graphics g){
		super.paintComponent(g);
		g.drawImage(img, 0, 0, null);
	}
	
	
}
